package com.qi.demo01.function;

import java.util.function.Supplier;

/**
 * @author zjq
 * @date 2020/3/28 21:54
 */

/**
 * Supplier  共给型接口，没有参数，只有返回值
 */
public class SupplierDemo {
    public static void main(String[] args) {
//        Supplier<String> supplier = new Supplier<String>() {
//
//            @Override
//            public String get() {
//                System.out.println("get()");
//                return 1024+"";
//            }
//        };
//        System.out.println(supplier.get());
        Supplier<String> supplier = () -> {
            return 1024 + "";
        };
        System.out.println(supplier.get());
    }
}
